home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15712 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: sarah.netmedia.co.il!usenet
  2. From: Meir Dukhan <meir@bis.co.il>
  3. Newsgroups: comp.os.linux.development.apps,comp.unix.programmer,comp.lang.c
  4. Subject: Assembler Statement in C program
  5. Date: Sun, 21 Apr 1996 13:50:29 +0200
  6. Organization: BIS Software Ltd
  7. Message-ID: <317A2105.77EF485@bis.co.il>
  8. NNTP-Posting-Host: 192.115.155.42
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.3 i486)
  13. CC: meir@bis.co.il
  14.  
  15. Hi, 
  16.  
  17. I'm trying to port some piece of C code to linux/unix.
  18. This code contains statement in assembler.
  19.  
  20. 1. How can I compile it under linux with gcc or gas ?
  21.  
  22. 2. Will this be portable ?
  23.  
  24. example:
  25.  
  26. static void clear_screen(void)
  27. {
  28.     _asm
  29.      {
  30.          mov   ax,40h
  31.          mov   es,ax
  32.          mov   ax,0600h
  33.          mov   bx,0700h
  34.          mov   cx,0
  35.          mov   dl, es:byte ptr[4ah]
  36.          dec   dl
  37.          mov   dh, es:byte ptr[84h]
  38.          or    dh,dh
  39.          jnz   k1
  40.          mov   dh,24
  41. k1:
  42.          int   10h
  43.          mov   dx,0
  44.          mov   ax,0200h
  45.          mov   bx,0
  46.          int   10h
  47.      }
  48. }
  49.  
  50.  
  51. -- 
  52.         Meir
  53.